//
//  CommunityViewController.m
//  Products_B
//
//  Created by lanou on 16/5/27.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "CommunityViewController.h"

@interface CommunityViewController ()

@end

@implementation CommunityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.navigationController.navigationBar.translucent = NO;
    
    UIButton *recommendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [recommendBtn setTitle:@"推荐" forState:(UIControlStateNormal)];
    [recommendBtn setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    [recommendBtn addTarget:self action:@selector(recommendBtn) forControlEvents:UIControlEventTouchUpInside];
       recommendBtn.frame = CGRectMake(100, 3, 50, 32); // where you can set your insets
    UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(100,0, 250, 40)] ;
//    customView.backgroundColor = [UIColor redColor];
//    customView.userInteractionEnabled = NO;
    [customView addSubview:recommendBtn];
    UIBarButtonItem *barBtn = [[UIBarButtonItem alloc] initWithCustomView:customView];
    
    
    UIButton *attentionBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [attentionBtn addTarget:self action:@selector(attentionBtn) forControlEvents:UIControlEventTouchUpInside];
    [attentionBtn setTitle:@"关注" forState:(UIControlStateNormal)];
    [attentionBtn setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    attentionBtn.frame = CGRectMake(160, 3, 50, 32);
    [customView addSubview:attentionBtn];
    
    UIView *v1 = [[UIView alloc]initWithFrame:CGRectMake(100, 63, 250, 5)];
    v1.backgroundColor = [UIColor orangeColor];
    
    UIButton *newestBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [newestBtn setTitle:@"最新" forState:(UIControlStateNormal)];
    [newestBtn addTarget:self action:@selector(newestBtn) forControlEvents:UIControlEventTouchUpInside];
    [newestBtn setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    newestBtn.frame = CGRectMake(220, 3, 50, 32);
    [customView addSubview:newestBtn];

    
    self.navigationItem.leftBarButtonItems = @[barBtn];


}

-(void)recommendBtn{
    
}

-(void)attentionBtn{

}

-(void)newestBtn{

}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
